package com.service.impl;

import com.domain.Person;
import com.mapper.Personmaper;
import com.mapper.Usermapper;
import com.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
@Transactional
public class PersonImpl implements PersonService {
    /**
     * @return
     */


    @Autowired
    private Personmaper personmapper;




    @Override
    public List<Person> findallperson() {
     return personmapper.findallperson();

    }

    /**
     * @param person
     */
    @Override
    public void addperson(Person person) {
        System.out.println("执行插入成功");
        personmapper.addperson(person);

    }

    /**
     * @return
     */
    @Override
    public List<Person> searchall(String id,String name) {
        System.out.println("执行sql语句");
     return personmapper.searchall(id,name);
    }

    /**
     * @param id
     * @param name
     * @param password
     */
    @Override
    public void editperson(String id, String name, String password) {
        personmapper.editperson(id,name,password);

    }

    /**
     * @param id
     */
    @Override
    public void delperson(String id) {
        personmapper.delperson(id);
    }


}
